package com.dkts.oil.web.vo.request;

import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;


@Schema(description = "公共的请求参数")
public class CommonRequest implements Serializable {
    @Schema(description  = "每页返回数量" ,example = "10")
    private Integer pageSize;

    @Schema(description  = "第几页" ,example = "1")
    private Integer pageNum;

    public CommonRequest(){

    }

    public CommonRequest(Integer pageNum,Integer pageSize){
        this.pageNum=pageNum;
        this.pageSize=pageSize;
    }

    public Integer getPageSize() {
        if(pageSize==null){
            pageSize=1;
        }
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNum() {
        if(pageNum==null || pageNum<=0){
            pageNum=1;
        }
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }
}
